<html>
<head><meta charset="utf-8"><title>Debugging extern linking issues · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html">Debugging extern linking issues</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227569412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Debugging%20extern%20linking%20issues/near/227569412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html#227569412">(Feb 24 2021 at 09:18)</a>:</h4>
<p>Hello, I'm trying to link a direct dependency crate manually using <code>rustc</code>, and i was wondering if there is a way to get more information from the compiler about what's failing in the linking crates process? Right now it always fails with <code>E0463</code> (<code>can't find crate for foo</code>), however I am specifying <code>--extern foo=target/debug/libfoo.rlib</code> which points to a real file, so there must be some other reason why it can't find or use the crate that it's not mentioning, and with the current error I don't know how to address the problem.</p>



<a name="227569766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Debugging%20extern%20linking%20issues/near/227569766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html#227569766">(Feb 24 2021 at 09:21)</a>:</h4>
<p>Logs should have a little bit more information: <code>env RUSTC_LOG=rustc_metadata=info rustc ...</code></p>



<a name="227569936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Debugging%20extern%20linking%20issues/near/227569936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html#227569936">(Feb 24 2021 at 09:23)</a>:</h4>
<p><span class="user-mention" data-user-id="352985">@tm</span> Indeed it does! Thanks for that.</p>



<a name="227622905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Debugging%20extern%20linking%20issues/near/227622905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html#227622905">(Feb 24 2021 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="219696">@XAMPPRocky</span> Out of curiosity, what was the issue?  I've been wanting to improve those error messages (some of the causes aren't displayed which could be helpful).</p>



<a name="227623281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Debugging%20extern%20linking%20issues/near/227623281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> XAMPPRocky <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Debugging.20extern.20linking.20issues.html#227623281">(Feb 24 2021 at 16:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> Please do! I was going to file an issue about that error message.</p>
<p>The specific problem I was running into was I was trying to link an host rlib with a target rlib whose platforms have incompatible rlib formats. (macOS &amp; Linux)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>